/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include <lib3d/model/ModelInHardware.h>
#include "Model.h"
#include "Factory.h"
#include <CompilerFeatures.h>

namespace liba
{
namespace lib3d
{
namespace node
{

class ModelFixed : public Model
{
	NODE_DEFINITION(ModelFixed)
public:
	static const Atom node_name;
	static const Atom source_name;
	static const Atom shadow_source_name;

	ModelFixed(const Atom & name, Node * parent);
	ModelFixed(const ModelFixed& rhs);
	virtual ~ModelFixed();
	virtual ModelFixed * Clone();

//	virtual bool render( hard::Hardware * hardware, const CameraDesc & camera_desc );
	virtual void RenderToList( hard::Hardware * hardware, hard::RenderList * render_list ) LIBA_OVERRIDE;
protected:
	virtual bool on_attribute( xml::Provider * prov, const std::string & name, const std::string & value ) LIBA_OVERRIDE;
private:
	SharedPrecached<filesystem::String, model::ModelInHardware> normal_model;
#ifndef IPHONE_VERSION
	SharedPrecached<filesystem::String, model::ModelInHardware> shadow_model;
#endif

	void ShadowSourceChanged(const filesystem::String& value);
	properties::DependencyProperty<filesystem::String> shadowSource;
};

} // namespace node
} // namespace lib3d
} // namespace liba
using namespace liba;

